<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入React核心包 -->
    <script src="../react18/react.development.js"></script>
    <!-- 引入React DOM包,提供ReactDOM对象 -->
    <script src="../react18/react-dom.development.js"></script>
    <!-- 引入Babel的包,将jsx语法解析成JS语法 -->
    <script src="../react18/babel.min.js"></script>
    <style>
        .outer{
            width: 100px;
            height: 100px;
            background-color: antiquewhite;
        }
    </style>
</head>
<body>
    <div id="app"></div>   
    <script type="text/babel">
        // 如果需要babel对当前的script内部的jsx进行编译,则需设置script的type属性
        
        //案例:
        const vDOM = (
            <div className="outer">
                <h1>JSX</h1>  
                <p>暂时还不知道怎么用</p>
            </div>
        )
        //创建容器并渲染虚拟DOM
        ReactDOM.createRoot(document.getElementById("app")).render(vDOM)
    </script>    
    
</body>
</html>